package com.hluck.goodweatherapp;

import com.baidu.location.LocationClient;
import com.hluck.goodweatherapp.data.db.AppDatabase;
import com.hluck.goodweatherapp.data.network.NetworkRequiredInfo;
import com.hluck.goodweatherapp.utils.MVUtils;
import com.hluck.mvvmlibrary.BaseApplication;
import com.hluck.mvvmlibrary.network.NetworkApi;
import com.tencent.mmkv.MMKV;

/**
 * @Author： LJH
 * @Time： 2023/12/13
 * @description：
 */
public class App extends BaseApplication {

    public static final String TAG = "WeatherApp";

    @Override
    public void onCreate() {
        super.onCreate();
        //使用定位需要同意
        LocationClient.setAgreePrivacy(true);

        //初始化网络框架
        NetworkApi.init(new NetworkRequiredInfo(this));
        //MMKV初始化
        MMKV.initialize(this);
        //工具类初始化
        MVUtils.getInstance();
    }

    public static AppDatabase getDatabase() {
        return AppDatabase.getInstance(getApplication());
    }
}
